package wechat.base.snd;

import org.eclipse.xtend.lib.annotations.Accessors;
import org.eclipse.xtext.xbase.lib.Exceptions;
import org.eclipse.xtext.xbase.lib.Pure;
import org.json.JSONException;
import org.json.JSONObject;

@SuppressWarnings("all")
public class ErrorMsg {
  @Accessors
  private String errcode;
  
  @Accessors
  private String errmsg;
  
  public ErrorMsg(final JSONObject errorInfo) {
    try {
      this.errcode = errorInfo.getString("errcode");
      this.errmsg = errorInfo.getString("errmsg");
    } catch (final Throwable _t) {
      if (_t instanceof JSONException) {
        final JSONException e = (JSONException)_t;
        e.printStackTrace();
      } else {
        throw Exceptions.sneakyThrow(_t);
      }
    }
  }
  
  @Pure
  public String getErrcode() {
    return this.errcode;
  }
  
  public void setErrcode(final String errcode) {
    this.errcode = errcode;
  }
  
  @Pure
  public String getErrmsg() {
    return this.errmsg;
  }
  
  public void setErrmsg(final String errmsg) {
    this.errmsg = errmsg;
  }
}
